package com.hangzhou.welbeing.welbeinginstrument.fragement;

import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.hangzhou.welbeing.welbeinginstrument.R;
import com.hangzhou.welbeing.welbeinginstrument.base.MyApplication;

import java.util.ArrayList;
import java.util.List;

import butterknife.ButterKnife;

/**
 * 时间 2017 年 08 月 21.
 * 作者 Administrator  刘传华
 * 公司 杭州惟君医疗科技有限公司
 * 包名 com.hangzhou.welbeing.pregnant.welbeing_pregnant.fragement
 * 工程名 welbeing_pregnant
 */
public class MallFragment extends Fragment {
//    @Bind(R.id.fragment_mall_banner)
//    Banner fragmentMallBanner;
//    @Bind(R.id.fragment_mall_recycleView)
//    RecyclerView fragmentMallRecycleListView;
    private Context mcontext = MyApplication.getMcontext();
    private List<Integer> images = new ArrayList<>();
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = View.inflate(mcontext, R.layout.fragment_mall, null);
        ButterKnife.bind(this, view);
        images.add(R.mipmap.raw);
        images.add(R.mipmap.raw);
        images.add(R.mipmap.raw);
       // fragmentMallBanner.setImages(images).setImageLoader(new GlideImageLoader()).start();

        GridLayoutManager mLayoutManager= new  GridLayoutManager(mcontext,2);
        //mLayoutManager.setOrientation(GridLayoutManager.VERTICAL);
        mLayoutManager.setOrientation(LinearLayoutManager.HORIZONTAL);
//        fragmentMallRecycleListView.setLayoutManager(mLayoutManager);
//        fragmentMallRecycleListView.setLayoutManager(mLayoutManager);
//        //如果可以确定每个item的高度是固定的，设置这个选项可以提高性能
//        fragmentMallRecycleListView.setHasFixedSize(true);
//        MallFragmentAdapter mallFragmentAdapter =  new MallFragmentAdapter();
//        fragmentMallRecycleListView.setAdapter(mallFragmentAdapter);
        return view;
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        ButterKnife.unbind(this);
    }
}
